package fun.lifepoem.demo.handle;

import fun.lifepoem.demo.exception.NotRoleException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author Yiwyn
 * @create 2022/12/4 1:48
 */
@RestControllerAdvice
public class GlobalExceptionHandle {


    @ExceptionHandler(NotRoleException.class)
    public String handleServiceException(NotRoleException exception) {
        return exception.getMessage();
    }


}
